import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)

export default new Router({
  routes: [{
    path: '/',
    component: resolve => require(['@/pages/_layout'], resolve),
    children: [ // 学习部分
      {
        path: '/',
        name: 'study',
        component: resolve => require(['@/pages/study/study_home'], resolve),
        meta: {
          title: '学习'
        }
      }, {
        path: '/login',
        name: 'login',
        component: resolve => require(['@/pages/login'], resolve),
        meta: {
          title: '登陆'
        }
      }, {
        path: '/task/ongoing',
        name: 'study_task',
        component: resolve => require(['@/pages/study/study_task'], resolve),
        meta: {
          title: '进行中任务'
        }
      }, {
        path: '/task/notstart',
        name: 'study_task',
        component: resolve => require(['@/pages/study/study_task'], resolve),
        meta: {
          title: '未开始任务'
        }
      }, {
        path: '/task/completed',
        name: 'study_task',
        component: resolve => require(['@/pages/study/study_task'], resolve),
        meta: {
          title: '已结束任务'
        }
      }, {
        path: '/task/overdue',
        name: 'study_task',
        component: resolve => require(['@/pages/study/study_task'], resolve),
        meta: {
          title: '已过期任务'
        }
      }, {
        path: '/notice',
        name: 'study_notice',
        component: resolve => require(['@/pages/study/study_notice'], resolve),
        meta: {
          title: '公告列表'
        }
      }, {
        path: '/notice/detail',
        name: 'study_notice_detail',
        component: resolve => require(['@/pages/study/study_notice_detail'], resolve),
        meta: {
          title: '公告详情'
        }
      }, // 发现部分
      {
        path: '/find',
        name: 'find_home',
        component: resolve => require(['@/pages/find/find_home'], resolve),
        meta: {
          title: '发现'
        }
      }, {
        path: '/find/search',
        name: 'find_search',
        component: resolve => require(['@/pages/find/find_search'], resolve),
        meta: {
          title: '课程列表'
        }
      },
      // 我的
      {
        path: '/myself',
        name: 'myself_page',
        component: resolve => require(['@/pages/myself/myself_page'], resolve),
        meta: {
          title: '个人中心'
        }
      },  {
        path: '/myself/course',
        name: 'mycourse',
        component: resolve => require(['@/pages/myself/mycourse'], resolve),
        meta: {
          title: '我的课程'
        }
      }, {
        path: '/myself/class',
        name: 'myclass',
        component: resolve => require(['@/pages/myself/myclass'], resolve),
        meta: {
          title: '我的班级'
        }
      }, {
        path: '/myself/test',
        name: 'mytest',
        component: resolve => require(['@/pages/myself/mytest'], resolve),
        meta: {
          title: '我的考试'
        }
      }, {
        path: '/myself/contrail',
        name: 'mycontrail',
        component: resolve => require(['@/pages/myself/mycontrail'], resolve),
        meta: {
          title: '我的考试'
        }
      }, {
        path: '/myself/set',
        name: 'myset',
        component: resolve => require(['@/pages/myself/myset'], resolve),
        meta: {
          title: '个人信息'
        }
      }
      //考试相关
      , {
        path: '/exam/detail/:id',
        name: 'exam_audio_detail',
        component: resolve => require(['@/pages/exam/exam_detail'], resolve),
        meta: {
          title: '考试详情'
        }
      
      },
      // 班级
      {
        path: '/class',
        name: 'class_page',
        component: resolve => require(['@/pages/class/class_page'], resolve),
        meta: {
          title: '班级'
      }
      }]
    }]
})
